#ifndef _UART_API_H
#define _UART_API_H

#include "uart/uart_driver.h"

#ifdef __cplusplus
extern "C" {
#endif


EXTERN DEVICE_PUBLIC(uart_device_t *) uart_device_find(const char *name);
EXTERN DEVICE_PUBLIC(int) uart_device_init(uart_device_t *dev, uart_device_config_t *cfg);
EXTERN DEVICE_PUBLIC(int) uart_device_deinit(uart_device_t *dev);
EXTERN DEVICE_PUBLIC(int) uart_device_received(uart_device_t *dev, void *data, uint32_t len);
EXTERN DEVICE_PUBLIC(int) uart_device_transmit(uart_device_t *dev, void *data, uint32_t len);
EXTERN DEVICE_PUBLIC(int) uart_device_set_baudrate(uart_device_t *dev, uart_device_baudrate_t baudrate);
EXTERN DEVICE_PUBLIC(int) uart_device_set_databits(uart_device_t *dev, uart_device_data_bits_t databits);
EXTERN DEVICE_PUBLIC(int) uart_device_set_stopbits(uart_device_t *dev, uart_device_stop_bits_t stopbits);
EXTERN DEVICE_PUBLIC(int) uart_device_set_parity(uart_device_t *dev, uart_device_parity_t parity);
EXTERN DEVICE_PUBLIC(int) uart_device_set_flowctrl(uart_device_t *dev, uart_device_flow_control_t flowctrl);
EXTERN DEVICE_PUBLIC(int) uart_device_event_cb_add(uart_device_t *dev, uart_event_cb evt_cb, void *user_data);
EXTERN DEVICE_PUBLIC(int) uart_device_event_cb_remove(uart_device_t *dev);
EXTERN DEVICE_PUBLIC(int) uart_device_irq_enable(uart_device_t *dev);
EXTERN DEVICE_PUBLIC(int) uart_device_irq_disable(uart_device_t *dev);
EXTERN DEVICE_PUBLIC(int) uart_device_lowpower_enter(uart_device_t *dev);
EXTERN DEVICE_PUBLIC(int) uart_device_lowpower_exit(uart_device_t *dev);

#ifdef __cplusplus
}
#endif

#endif

